package com.javatip.project.deep_learning.trainMission.service;

import com.javatip.project.deep_learning.trainMission.domain.TrainMission;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 训练任务 服务层
 *
 * @author 袁伟
 * @date 2024-07-12
 */
public interface ITrainMissionService {
    /**
     * 查询训练任务信息
     *
     * @param id 训练任务ID
     * @return 训练任务信息
     */
    public TrainMission selectTrainMissionById(Integer id);

    /**
     * 查询训练任务列表
     *
     * @param trainMission 训练任务信息
     * @return 训练任务集合
     */
    public List<TrainMission> selectTrainMissionList(TrainMission trainMission);

    /**
     * 新增训练任务
     *
     * @param trainMission 训练任务信息
     * @return 结果
     */
    public int insertTrainMission(TrainMission trainMission);

    /**
     * 修改训练任务
     *
     * @param trainMission 训练任务信息
     * @return 结果
     */
    public int updateTrainMission(TrainMission trainMission);

    /**
     * 删除训练任务信息
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTrainMissionByIds(String ids);

    public int startSingleTraining(int id);

    public boolean stopSingleTraining(int id);

    public int updateStatusToWait(int id);

    public int updateStatusToNotTrain(int id);

    public List<TrainMission> selectWaitAndTrainingList();

    public int stopTraining();

    public int doTrain();

    public List<TrainMission> selectFinishedList(TrainMission trainMission);

    public int deleteTrainMissionById(Integer id);

    public void setTimeToQueue(int id);


    public boolean isTrainMissionNameExists(String name, int userId);

    public int calculateQueuePosition(Date timeToQueue,int id);

    public List<TrainMission> selectTrainMissionListByUser(int currentUserId, TrainMission trainMission);

    public List<TrainMission> selectTrainMissionListWithUserOrPublic(Integer currentUserId, TrainMission trainMission);
}
